package com.gpnu.crm.domain;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import com.alibaba.fastjson.JSONObject;

import lombok.Data;

/**
 * 客户表
 * 
 * @author wangqing
 */
@Data
public class Customer {
	
	public static final Integer STATUS_NORMAL = Integer.valueOf(0);
	public static final Integer STATUS_POOL = Integer.valueOf(1);
	public static final Integer STATUS_FAIL = Integer.valueOf(2);
	public static final Integer STATUS_LOST = Integer.valueOf(3);
	public static final Integer STATUS_FORMAL = Integer.valueOf(4);
	
	private Long id;
	private String name;// 姓名
	private Integer age;// 年龄
	private Integer gender;// 性别 0女/1男
	private String tel;// 电话
	private String qq;// qq

	/*
	 * private Long jobId; //职业id private Long sourceId;//来源id
	 */ 
	private Employee seller;// 销售员
	private Date inputTime;// 录入时间
	private Integer status;// 状态

	private SystemDictionaryItem job;
	private SystemDictionaryItem source;
//	private String genderName;

	private Employee inputUser;
	
	public String getGenderName() {
		if (gender == 1) {
			return "男";
		}
		return "女";
	}

	public String getStatusName() {
		if (status == 1) {
			return "客户池";
		} else if (status == 2) {
			return "开发失败";
		} else if (status == 3) {
			return "流失";
		} else if (status == 4) {
			return "正式客户";
		}
		return "潜在用户";
	}

	public String getJson() {
		Map<String, Object> map = new HashMap();
		map.put("id", id);
		map.put("name", name);
		map.put("age", age);
		map.put("gender", gender);
		map.put("tel", tel);
		map.put("qq", qq);
		map.put("jobId", job.getId());
		map.put("sourceId", source.getId());
		map.put("sellerId", seller.getId());
		map.put("sellerName", seller.getName());
		return JSONObject.toJSONString(map);
	}



}
